<template>
  <CommonContainer title="订单信息">
    <el-descriptions>
      <el-descriptions-item label="主订单编号">
        <span @click="goMainOrderDetail()" style="color: #1890ff; cursor: pointer">  {{ contractInfo.contractReportNumber|filterNull }}</span>

      </el-descriptions-item>
      <el-descriptions-item label="子订单编号">
        <span @click="goOrderDetail()" style="color: #1890ff; cursor: pointer"> {{ contractInfo.orderNumber|filterNull }}</span>
      </el-descriptions-item>
      <el-descriptions-item label="产品类型">{{ contractInfo.productTypeStr|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="客户">
        <span @click="goMemberDetail()" style="color: #1890ff; cursor: pointer"> {{ contractInfo.customer|filterNull }}</span>
      </el-descriptions-item>
      <el-descriptions-item label="客户编码">{{ contractInfo.customerCode|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="业务来源">{{ contractInfo.channelSource|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="子订单租赁开始时间">{{ contractInfo.contractStartTime|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="子订单租赁结束时间">{{ contractInfo.contractEndTime|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="合同约定公里数">{{ contractInfo.contractMileage|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="租期">{{ contractInfo.leaseTerm|filterNull }}月</el-descriptions-item>
<!--      <el-descriptions-item label="已履行租期">{{ contractInfo.fulfilledLeaseTerm|filterNull }}</el-descriptions-item>-->
      <el-descriptions-item label="租金">{{ format_thousand(contractInfo.rent)|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="合同保证金">{{ format_thousand(contractInfo.margin)|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="车牌号" :span="(contractInfo.productTypeCode == 2 || contractInfo.productTypeCode == 4)?1:2">{{ contractInfo.licensePlateNumber|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="首期租金" v-if="contractInfo.productTypeCode == 2 || contractInfo.productTypeCode == 4">{{ format_thousand(contractInfo.firstMonthRent)|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="违章保证金">{{ format_thousand(contractInfo.violation)|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="车架号" :span="(contractInfo.productTypeCode == 2 || contractInfo.productTypeCode == 4)?1:2">{{ contractInfo.frameNumber|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="尾款" v-if="contractInfo.productTypeCode == 2 || contractInfo.productTypeCode == 4">{{ format_thousand(contractInfo.balancePayment)|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="业务担当">{{ contractInfo.businessRepresentative|filterNull }}</el-descriptions-item>
      <el-descriptions-item label="品牌/车系/车型" :span="3">{{ contractInfo.brandSeriesModel|filterNull }}</el-descriptions-item>

    </el-descriptions>
  </CommonContainer>
</template>

<script>
import {orderCarParam} from "@/api/gps/gpsList";

export default {
  components: {},
  props: {
    contractInfo: {
      type: Object,
      default: () => {
        return {}
      }
    },
    customerId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {}
  },
  computed: {},
  methods: {
    goMainOrderDetail() {
      this._toPage({
        name: "OrderDetails",
        query: {
          type: 1,
          orderId: this.contractInfo.orderId,
          calcSchemeId: this.contractInfo.calcSchemeId
        },
      });

    },
    goOrderDetail() {
      orderCarParam(this.contractInfo.orderNumber)
          .then(res => {
            if (res.code == 200) {
              this._toPage({
                name: "SuborderDetail",
                query: {
                  id: res.data.orderCarId,
                  orderId: res.data.orderCarCode
                },
              });
            } else {
              throw new Error(res);
            }
          })
    },
    goMemberDetail() {
      this._toPage({
        name: 'memberDetail',
        query: {customerId: this.customerId}
      })
    },
  },
  mounted() {
  },

}
</script>

<style lang="scss" scoped>
</style>
